﻿Imports System.ComponentModel

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class ucLectureDetails
    Inherits UcBaseEditControl
    Implements IUcEditControl

#Region "Designer"
    'UserControl overrides dispose to clean up the component list.
    <System.Diagnostics.DebuggerNonUserCode()> _
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    End Sub

    Public Sub New()

        ' This call is required by the designer.
        InitializeComponent()
        
        ' Add any initialization after the InitializeComponent() call.
        
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()> _
    Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container()
        Me.PeriodIdlbl = New System.Windows.Forms.Label()
        Me.PeriodId = New org.codegen.win.controls.CGComboBox(Me.components)
        Me.LessonIdlbl = New System.Windows.Forms.Label()
        Me.LessonId = New org.codegen.win.controls.CGComboBox(Me.components)
        Me.ExamCenterIDlbl = New System.Windows.Forms.Label()
        Me.ExamCenterID = New org.codegen.win.controls.CGComboBox(Me.components)
        Me.LectureDatelbl = New System.Windows.Forms.Label()
        Me.LectureDate = New org.codegen.win.controls.CGDateTextBox(Me.components)
        Me.LectureTimeFromlbl = New System.Windows.Forms.Label()
        Me.LectureTimeFrom = New org.codegen.win.controls.CGTimeBox()
        Me.LectureTimeTolbl = New System.Windows.Forms.Label()
        Me.LectureTimeTo = New org.codegen.win.controls.CGTimeBox()
        CType(Me.ErrProvider, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'PeriodIdlbl
        '
        Me.PeriodIdlbl.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.PeriodIdlbl.Location = New System.Drawing.Point(5, 15)
        Me.PeriodIdlbl.Name = "PeriodIdlbl"
        Me.PeriodIdlbl.Size = New System.Drawing.Size(120, 20)
        Me.PeriodIdlbl.TabIndex = 0
        Me.PeriodIdlbl.Text = "Period"
        Me.PeriodIdlbl.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        '
        'PeriodId
        '
        Me.PeriodId.AssociatedLabel = Me.PeriodIdlbl
        Me.PeriodId.BackColor = System.Drawing.Color.LightYellow
        Me.PeriodId.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.PeriodId.ErrProvider = Nothing
        Me.PeriodId.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.PeriodId.isMandatory = True
        Me.PeriodId.Location = New System.Drawing.Point(135, 15)
        Me.PeriodId.MaxLength = 255
        Me.PeriodId.MaxValue = Nothing
        Me.PeriodId.MinValue = Nothing
        Me.PeriodId.Name = "PeriodId"
        Me.PeriodId.showAsteriskForMandatory = True
        Me.PeriodId.Size = New System.Drawing.Size(467, 21)
        Me.PeriodId.TabIndex = 0
        '
        'LessonIdlbl
        '
        Me.LessonIdlbl.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.LessonIdlbl.Location = New System.Drawing.Point(5, 45)
        Me.LessonIdlbl.Name = "LessonIdlbl"
        Me.LessonIdlbl.Size = New System.Drawing.Size(120, 20)
        Me.LessonIdlbl.TabIndex = 1
        Me.LessonIdlbl.Text = "Subject"
        Me.LessonIdlbl.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        '
        'LessonId
        '
        Me.LessonId.AssociatedLabel = Me.LessonIdlbl
        Me.LessonId.BackColor = System.Drawing.Color.LightYellow
        Me.LessonId.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.LessonId.ErrProvider = Nothing
        Me.LessonId.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.LessonId.isMandatory = True
        Me.LessonId.Location = New System.Drawing.Point(135, 45)
        Me.LessonId.MaxLength = 255
        Me.LessonId.MaxValue = Nothing
        Me.LessonId.MinValue = Nothing
        Me.LessonId.Name = "LessonId"
        Me.LessonId.showAsteriskForMandatory = True
        Me.LessonId.Size = New System.Drawing.Size(467, 21)
        Me.LessonId.TabIndex = 1
        '
        'ExamCenterIDlbl
        '
        Me.ExamCenterIDlbl.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.ExamCenterIDlbl.Location = New System.Drawing.Point(5, 75)
        Me.ExamCenterIDlbl.Name = "ExamCenterIDlbl"
        Me.ExamCenterIDlbl.Size = New System.Drawing.Size(120, 20)
        Me.ExamCenterIDlbl.TabIndex = 2
        Me.ExamCenterIDlbl.Text = "Exam Center"
        Me.ExamCenterIDlbl.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        '
        'ExamCenterID
        '
        Me.ExamCenterID.AssociatedLabel = Me.ExamCenterIDlbl
        Me.ExamCenterID.BackColor = System.Drawing.Color.Transparent
        Me.ExamCenterID.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.ExamCenterID.ErrProvider = Nothing
        Me.ExamCenterID.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.ExamCenterID.isMandatory = False
        Me.ExamCenterID.Location = New System.Drawing.Point(135, 75)
        Me.ExamCenterID.MaxLength = 255
        Me.ExamCenterID.MaxValue = Nothing
        Me.ExamCenterID.MinValue = Nothing
        Me.ExamCenterID.Name = "ExamCenterID"
        Me.ExamCenterID.showAsteriskForMandatory = True
        Me.ExamCenterID.Size = New System.Drawing.Size(467, 21)
        Me.ExamCenterID.TabIndex = 2
        '
        'LectureDatelbl
        '
        Me.LectureDatelbl.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.LectureDatelbl.Location = New System.Drawing.Point(5, 105)
        Me.LectureDatelbl.Name = "LectureDatelbl"
        Me.LectureDatelbl.Size = New System.Drawing.Size(120, 20)
        Me.LectureDatelbl.TabIndex = 3
        Me.LectureDatelbl.Text = "Lecture Date"
        Me.LectureDatelbl.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        '
        'LectureDate
        '
        Me.LectureDate.AssociatedLabel = Me.LectureDatelbl
        Me.LectureDate.BackColor = System.Drawing.Color.Transparent
        Me.LectureDate.ErrProvider = Nothing
        Me.LectureDate.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.LectureDate.isMandatory = False
        Me.LectureDate.Location = New System.Drawing.Point(135, 105)
        Me.LectureDate.MaxLength = 12
        Me.LectureDate.MaxValue = Nothing
        Me.LectureDate.MinValue = Nothing
        Me.LectureDate.Name = "LectureDate"
        Me.LectureDate.showAsteriskForMandatory = True
        Me.LectureDate.Size = New System.Drawing.Size(200, 21)
        Me.LectureDate.TabIndex = 3
        '
        'LectureTimeFromlbl
        '
        Me.LectureTimeFromlbl.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.LectureTimeFromlbl.Location = New System.Drawing.Point(5, 135)
        Me.LectureTimeFromlbl.Name = "LectureTimeFromlbl"
        Me.LectureTimeFromlbl.Size = New System.Drawing.Size(120, 20)
        Me.LectureTimeFromlbl.TabIndex = 4
        Me.LectureTimeFromlbl.Text = "Lecture Time From"
        Me.LectureTimeFromlbl.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        '
        'LectureTimeFrom
        '
        Me.LectureTimeFrom.AssociatedLabel = Me.LectureTimeFromlbl
        Me.LectureTimeFrom.BackColor = System.Drawing.Color.Transparent
        Me.LectureTimeFrom.ErrProvider = Nothing
        Me.LectureTimeFrom.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.LectureTimeFrom.isMandatory = False
        Me.LectureTimeFrom.Location = New System.Drawing.Point(135, 135)
        Me.LectureTimeFrom.MaxLength = 3
        Me.LectureTimeFrom.MaxValue = Nothing
        Me.LectureTimeFrom.MinValue = Nothing
        Me.LectureTimeFrom.Name = "LectureTimeFrom"
        Me.LectureTimeFrom.showAsteriskForMandatory = True
        Me.LectureTimeFrom.Size = New System.Drawing.Size(200, 21)
        Me.LectureTimeFrom.TabIndex = 4
        '
        'LectureTimeTolbl
        '
        Me.LectureTimeTolbl.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.LectureTimeTolbl.Location = New System.Drawing.Point(5, 165)
        Me.LectureTimeTolbl.Name = "LectureTimeTolbl"
        Me.LectureTimeTolbl.Size = New System.Drawing.Size(120, 20)
        Me.LectureTimeTolbl.TabIndex = 5
        Me.LectureTimeTolbl.Text = "Lecture Time To"
        Me.LectureTimeTolbl.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        '
        'LectureTimeTo
        '
        Me.LectureTimeTo.AssociatedLabel = Me.LectureTimeTolbl
        Me.LectureTimeTo.BackColor = System.Drawing.Color.Transparent
        Me.LectureTimeTo.ErrProvider = Nothing
        Me.LectureTimeTo.Font = New System.Drawing.Font("Verdana", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.LectureTimeTo.isMandatory = False
        Me.LectureTimeTo.Location = New System.Drawing.Point(135, 165)
        Me.LectureTimeTo.MaxLength = 3
        Me.LectureTimeTo.MaxValue = Nothing
        Me.LectureTimeTo.MinValue = Nothing
        Me.LectureTimeTo.Name = "LectureTimeTo"
        Me.LectureTimeTo.showAsteriskForMandatory = True
        Me.LectureTimeTo.Size = New System.Drawing.Size(200, 21)
        Me.LectureTimeTo.TabIndex = 5
        '
        'ucLectureDetails
        '
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.AutoValidate = System.Windows.Forms.AutoValidate.EnableAllowFocusChange
        Me.Controls.Add(Me.PeriodIdlbl)
        Me.Controls.Add(Me.PeriodId)
        Me.Controls.Add(Me.LessonIdlbl)
        Me.Controls.Add(Me.LessonId)
        Me.Controls.Add(Me.ExamCenterIDlbl)
        Me.Controls.Add(Me.ExamCenterID)
        Me.Controls.Add(Me.LectureDatelbl)
        Me.Controls.Add(Me.LectureDate)
        Me.Controls.Add(Me.LectureTimeFromlbl)
        Me.Controls.Add(Me.LectureTimeFrom)
        Me.Controls.Add(Me.LectureTimeTolbl)
        Me.Controls.Add(Me.LectureTimeTo)
        Me.Name = "ucLectureDetails"
        Me.Size = New System.Drawing.Size(615, 205)
        CType(Me.ErrProvider, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)
        Me.PerformLayout()

    End Sub



    Friend WithEvents PeriodIdlbl As System.Windows.Forms.Label
    Friend WithEvents PeriodId As CGComboBox
    Friend WithEvents LessonIdlbl As System.Windows.Forms.Label
    Friend WithEvents LessonId As CGComboBox
    Friend WithEvents ExamCenterIDlbl As System.Windows.Forms.Label
    Friend WithEvents ExamCenterID As CGComboBox
    Friend WithEvents LectureDatelbl As System.Windows.Forms.Label
    Friend WithEvents LectureDate As CGDateTextBox
    Friend WithEvents LectureTimeFromlbl As System.Windows.Forms.Label
    Friend WithEvents LectureTimeFrom As CGTimeBox
    Friend WithEvents LectureTimeTolbl As System.Windows.Forms.Label
    Friend WithEvents LectureTimeTo As CGTimeBox


#End Region

#Region "Methods"

    ''' <summary>
    ''' Fills the controls on the screen from data in the object
    ''' </summary>
    ''' <remarks></remarks>
    Public Sub _loadData() Handles Me.evLoadObjectData

        Dim mo As Lecture = DirectCast(Me.ModelObject(), Lecture)
        Me.PeriodId.value = mo.PeriodId
        Me.LessonId.value = mo.LessonId
        Me.ExamCenterID.value = mo.ExamCenterID
        Me.LectureDate.value = mo.LectureDate
        Me.LectureTimeFrom.value = mo.LectureTimeFrom
        Me.LectureTimeTo.value = mo.LectureTimeTo
       
        If mo.isNew Then
            If My.Settings.CurrentPeriodId > 0 Then
                Me.PeriodId.Value = My.Settings.CurrentPeriodId

            End If
        End If

        If Me.PeriodId.intValue > 0 Then
            Me.PeriodId.ReadOnly = True
        End If

        Me.resetLastLoadedValues()
        Me.ErrProvider.Clear()

    End Sub


    ''' <summary>
    ''' Loads the object from the database and then sets the proeperties 
    ''' of the object from values on the controls
    ''' </summary>
    ''' <remarks></remarks>
    Public Sub _loadToObject() Handles Me.evLoadToObject

        Dim mo As Lecture = DirectCast(Me.ModelObject, Lecture)
        mo.PeriodId = Me.PeriodId.IntValue
        mo.LessonId = Me.LessonId.IntValue
        mo.ExamCenterID = Me.ExamCenterID.IntValue
        mo.setLectureDate(Me.LectureDate.text)
        mo.setLectureTimeFrom(Me.LectureTimeFrom.text)
        mo.setLectureTimeTo(Me.LectureTimeTo.text)
       

    End Sub

    Public Sub _InitializeControl() Handles Me.InitializeControl

        If Me.isInitialized = False Then
            'setup datasources
            Me.PeriodId.DataSource = New BusObjects.Mappers.PeriodDBMapper().findAll()
            Me.PeriodId.DisplayMember = "PeriodDescription"
            Me.PeriodId.ValueMember = "PeriodId"

            Me.LessonId.DataSource = New BusObjects.Mappers.LessonDBMapper(). _
                    findList("lessonid in (SELECT distinct(b.LessonId) FROM  Class AS b ,Period AS c where b.PeriodId = c.PeriodId and c.DiplomaSuperTypeId = 5)")

            Me.LessonId.DisplayMember = "LessonDescription"
            Me.LessonId.ValueMember = "LessonId"

            Me.ExamCenterID.DataSource = New BusObjects.Mappers.ExamCenterDBMapper().findAll()
            Me.ExamCenterID.DisplayMember = "CenterName"
            Me.ExamCenterID.ValueMember = "ExamCenterId"

            Me.isInitialized = True
        End If

    End Sub

#End Region


End Class


